<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body style="background-color: aqua;">
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		<script type="text/javascript">
			window.onload = function() {
				var input = document.getElementById("demo_input");
				var result = document.getElementById("result");
//				var img_area = document.getElementById("img_area");
				if(typeof(FileReader) === 'undefined') {
					result.innerHTML = "抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！";
					input.setAttribute('disabled', 'disabled');
				} else {
					input.addEventListener('change', readFile, false);
				}
			}

			function readFile() {
				var file = this.files[0];
				var reader = new FileReader();
				reader.readAsDataURL(file);
				reader.onload = function(e) {
					result.innerHTML = this.result;
					$.ajax({
						url: "http://192.168.10.64:8124/file",
						type: "POST",
						processData: false,
						contentType: false,
						data: this.result,
						success: function(d) {
							console.log(d);
						}
					});
				}
			}
		</script>
		<input type="file" value="sdgsdg" id="demo_input" />
		<div id="result" style="width: 100%; min-height: 80%;word-break:break-all;background-color: #EEEEEE;"></div>
	</body>
</html>